package com.yunxin.facerecognition.app;

import android.app.Application;
import android.content.Context;

import com.yunxin.facerecognition.component.AppComponent;
import com.yunxin.facerecognition.component.DaggerAppComponent;
import com.yunxin.facerecognition.module.AppModule;



/**
 * @类名: MyApp
 * @描述: 我的应用
 * @作者 cms
 * @创建日期 2016/12/14 15:21
 */
public class MyApp extends Application {

    private static AppComponent sAppComponent = null;


    public static Context context;

   //h public static final  String Url ="http://47.101.43.227:6662/";
    public static final  String Url ="http://punch.geegul.com/";

    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);

    }

    @Override
    public void onCreate() {
        super.onCreate();
        if (sAppComponent == null) {
            sAppComponent = DaggerAppComponent.builder()
                    .appModule(new AppModule(this))
                    .build();
        }
        
        context = this.getApplicationContext();

    }


    public AppComponent getAppComponent() {
        //向外界的依赖提供这个AppComponent
        return sAppComponent;
    }

}
